package com.langsin.factory;

import com.langsin.bean.Cat;

/**
 * @author LQWQK
 * @version 1.0
 * @since 2022-06-29 10:00:54
 */
public class LqwqkStaticFactory {

    // 静态工厂 . 方法是静态的
    public static Cat createCat(String type){
        String name = "tom猫";
        if("bosi".equals(type)){
            name = "波斯猫";
        }else if("jiafei".equals(type)){
            name = "加菲猫";
        }
        Cat cat = new Cat();
        cat.setCname(name);
        return cat;
    }
}
